<div class="server-param-pane">
    <div class="loading"></div>
    <div class="tab-navigation">
        <div class="navigation-title">{{i18n.navigation}}</div>
        <ul class="nav nav-pills nav-stacked">
            <li role="presentation" ng-class="{'active':$first}" ng-repeat="app in apps">
                <a ng-href="#{{app.id}}" data-toggle="tab">
                    {{app.appName}}
                    <span ng-hide="modifyItemNum['n'+app.id].sum===0"
                          class="badge modify-item">
                        {{i18n.modify}} {{modifyItemNum['n'+app.id].sum}}
                    </span>
                </a>
            </li>
        </ul>
    </div>

    <div class="tab-content">
        <div class="config-operation">
            <button class="btn btn-default btn-operation"
                    ng-click="events.importBtnClickEvt()" ng-disabled="exporting">
                <span class="icon icon-lg">
                    <span><i class="iconfont">&#xe645;</i></span>
                </span>
                {{i18n.importConfig}}
            </button>
            <button class="btn btn-default btn-operation"
                    ng-click="events.exportBtnClickEvt()">
                <span class="icon">
                    <span ng-hide="exporting"><i class="iconfont">&#xe607;</i></span>
                    <img ng-show="exporting" ng-click="stopProp($event)" ng-src="../shared/img/downloading.gif"/>
                </span>
                {{i18n.exportConfig}}
            </button>
            <button class="btn btn-default btn-operation btn-batch-release"
                    ng-click="events.batchReleaseBtnClickEvt()">
                <span class="icon">
                    <span><i class="iconfont">&#xe646;</i></span>
                </span>
                {{i18n.batchRelease}}
            </button>
        </div>
        <div class="tab-pane fade" ng-class="{'in active':$first}" id="{{app.id}}" ng-repeat="app in apps">
            <!-- EMS代理设置表格-->
            <div class="param-block" ng-if="app.emsProxy">
                <div class="block-operation">
                    <span class="block-title">{{i18n.emsProxySetting}}</span>
                    <button class="btn btn-success btn-release"
                            ng-click="events.publishBtnClickEvt(app.id,'emsProxy')">
                        <span><i class="iconfont">&#xe646;</i></span>{{i18n.release}}
                    </button>
                    <button class="btn btn-success btn-add-ems" ng-click="events.addEmsBtnClickEvt(app.id,'emsProxy')">
                        <span class="glyphicon glyphicon-plus"></span> {{i18n.addEmsProxy}}
                    </button>
                </div>
                <div id="grid_{{app.id}}_emsProxy" f-resize-kendo-ui class="server-grid ems-proxy-grid"
                     kendo-grid="grid_{{app.id}}_emsProxy"
                     options="options.emsProxyGridOption"></div>
            </div>
            <!-- 普通参数配置表格-->
            <div class="param-block" ng-repeat="param in app.params">
                <div class="block-operation">
                    <span class="block-title">{{param.namespace}}</span>
                    <button class="btn btn-success btn-release"
                            ng-click="events.publishBtnClickEvt(app.id,param.id,app.appId,param.namespace)">
                        <span><i class="iconfont">&#xe646;</i></span>
                        {{i18n.release}}
                    </button>
                    <f-filter-btn grid-for="grid_{{app.id}}_{{param.id}}">{{i18n.filter}}</f-filter-btn>
                </div>
                <div id="grid_{{app.id}}_{{param.id}}" f-resize-kendo-ui class="server-grid"
                     kendo-grid="grid_{{app.id}}_{{param.id}}"
                     options="options.getGridOption(app.id,param.id,app.appId,param.namespace)"></div>
            </div>
        </div>
    </div>
</div>

<!-- 导入配置文件窗口 -->
<div kendo-window="importConfigWin" class="import-config-win" options="options.importConfigWinOption">
    <div class="import-block">
        <span class="import-block-title">{{i18n.importFile}}</span>
        <span class="import-file-url"><span ng-hide="configFileErrMsg">{{configFile.name}}</span></span>
        <span class="btn btn-default import-block-btn">{{i18n.scan}}
            <input type="file" name="configFile" class="btn-scan" accept=".json"
                   onchange="angular.element(this).scope().events.selectedFileChangedEvt(this)"/>
        </span>
        <span ng-show="configFileErrMsg" class="import-err">
            <f-errormessage>{{configFileErrMsg}}</f-errormessage>
        </span>
    </div>
    <div class="file-info">
        <div id="configFileInfoGrid" f-resize-kendo-ui class="f-no-loading-mask"></div>
    </div>
    <div class="operation-btns">
        <button class="btn btn-info" type="button" ng-click="events.confirmBtnEvt()">{{I18N.OK}}</button>
        <button class="btn btn-default" type="button" ng-click="events.cancelBtnEvt()">{{I18N.CANCEL}}</button>
    </div>
</div>

<!-- 发布状态 列模板-->
<script id="release-cell-template" type="text/x-kendo-template">
    #: data.release? I18N.MODULE.SERVICE_CENTER.released:I18N.MODULE.SERVICE_CENTER.unReleased#
    <span class="badge" ng-if="#:data.status# !== 0"
          ng-class="{'modify-item': #:data.status# === 2 ,'new-item': #:data.status# === 1}">
            #: data.status===1? I18N.MODULE.SERVICE_CENTER.newItem:I18N.MODULE.SERVICE_CENTER.modifyItem#
        </span>
</script>

<!-- EMS代理表格 添加行 按钮模板-->
<script id="add-btn" type="text/x-kendo-template">
    <a class="k-button k-button-icontext k-grid-add" href="\#" ng-click="events.addEmsBtnClickEvt()">
        <span class="glyphicon glyphicon-plus"></span> {{i18n.addEmsProxy}}
    </a>
</script>

<!-- 配置文件信息表格checkbox列 列模板 -->
<script id="treelist-checkbox-column-template" type="text/x-kendo-template">
    #if(data.appId!=='ems-proxy'||data.parentId==undefined){#
    <input type="checkbox" id="n#:id #" class="k-checkbox" onclick="angular.element(this).scope().events.checkboxClickEvt('#:itemId#',this)"/>
    <label class="k-checkbox-label" for="n#:id #"/></label>
    #}#

</script>

<!-- 配置文件信息表格checkbox列 表头模板 -->
<script id="treelist-checkbox-head-template" type="text/x-kendo-template">
    <input type="checkbox" id="headCheckbox" class="k-checkbox" onclick="angular.element(this).scope().events.headCheckboxClickEvt('headCheckbox',this)"/>
    <label class="k-checkbox-label" for="headCheckbox"/></label>
</script>

<!-- EMS配置表格同步按钮模板 -->
<script id="sync-btn" type="text/x-kendo-template">
    <a id="sync-btn-a" ng-click="events.syncEmxProxyBtnClickEvt(dataItem.emsId);"
       class="k-button k-button-icontext sync-btn" href="\#" title="{{i18n.sync}}">
        <span><i class="iconfont">&\#xe738;</i></span>
    </a>
</script>